package com.wodsy.phoenix.dataobject.userc.constants;

public enum Week {
    //定义枚举类的值
    Monday(1,"星期一"),
    Tuesday(2,"星期二"),
    Wednesday(3,"星期三"),
    Thursday(4,"星期四"),
    Friday(5,"星期五"),
    Saturday(6,"星期六"){
        @Override
        public boolean isRest(){
            return true;
        }
    },
    Sunday(7,"星期日"){
        @Override
        public boolean isRest(){
            return true;
        }
    };
    private int code = 1;//缩写
    private String chineseName = "星期一";//中文名字
 
    //定义自己的构造器
    private Week(int code,String chineseName){
        this.code = code;
        this.chineseName = chineseName;
    }
    
    public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public void setChineseName(String chineseName) {
		this.chineseName = chineseName;
	}

	public String getChineseName(){
        return chineseName;
    }
 
    //周六和周日应该返回true，此方法在周六和周日的值中被重载
    public boolean isRest(){
        return false;
    }
   
    //重载，对它进行稍稍的改动
    @Override
    public String toString(){
        return this.getClass().getName()+"."+this.name();
    }
}